#!/bin/bash

/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_10.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :10 -ac -screen 0 1600x1200x16
cd $TRAVIS_BUILD_DIR/tests/Selenium
cp -n settings.travis.js settings.js
npm install --silent
DISPLAY=:10 npm run selenium &> /dev/null &
sleep 5
npm test
status=$?
cd $TRAVIS_BUILD_DIR
exit $status
